package com.zenithmind.chat.temp;

/**
 * 临时结果类 - 解决编译问题
 * 当common模块可用时，应该使用 com.zenithmind.common.result.Result
 */
public class Result<T> {
    
    private int code;
    private String message;
    private T data;
    
    public Result() {}
    
    public Result(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    
    public static <T> Result<T> success(T data) {
        return new Result<>(200, "成功", data);
    }
    
    public static <T> Result<T> success() {
        return new Result<>(200, "成功", null);
    }
    
    public static <T> Result<T> fail(int code, String message, T data) {
        return new Result<>(code, message, data);
    }
    
    public static <T> Result<T> fail(String message) {
        return new Result<>(500, message, null);
    }
    
    // Getters and Setters
    public int getCode() {
        return code;
    }
    
    public void setCode(int code) {
        this.code = code;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public T getData() {
        return data;
    }
    
    public void setData(T data) {
        this.data = data;
    }
}
